// $Id: swap_1.cpp 2 2009-09-02 08:47:42Z joseph2002 $
/*
 * Copyright 2009 Joseph Wu
 * Distributed under the Boost Software License, Version 1.0.
 * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
 *
 * For more information, see http://xpcomplus.sourceforge.net
 */

#include <boost/test/unit_test.hpp>
#include <xpcom/string.hpp>

BOOST_AUTO_TEST_CASE(test_swap_1)
{
    xpcom::string s1 = "Asss ui";
    xpcom::string s2 = s1;
    xpcom::string s3 = "wwww";
    xpcom::string s4 = s3;

    BOOST_CHECK(s1 == s2);
    BOOST_CHECK(s3 == s4);
    swap(s1, s3);
    BOOST_CHECK(s1 == s4);
    BOOST_CHECK(s3 == s2);

    s4.swap(s2);
    BOOST_CHECK(s1 == s2);
    BOOST_CHECK(s3 == s4);
}
